import 'package:distribution_mall_flutter/constant/cf_constant.dart';
import 'package:distribution_mall_flutter/generated/l10n.dart';
import 'package:flutter/material.dart';
import 'package:getwidget/getwidget.dart';
import 'package:auto_size_text/auto_size_text.dart';

class CartFooter extends StatelessWidget {
  const CartFooter({super.key});

  @override
  Widget build(BuildContext context) {
    return Positioned(
        // width: MediaQuery.of(context).size.width,
        left: 0,
        right: 0,
        bottom: 0,
        child: Container(
            width: MediaQuery.of(context).size.width,
            height: 60,
            padding: const EdgeInsets.symmetric(
                vertical: EdgeConstant.edge10, horizontal: EdgeConstant.edge20),
            decoration: const BoxDecoration(
                color: Colors.white,
                border: Border(
                    top: BorderSide(color: ColorConstant.grey233, width: 1))),
            child: Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Row(
                  crossAxisAlignment: CrossAxisAlignment.center,
                  children: [
                    SizedBox(
                      width: 15,
                      height: 15,
                      child: GFRadio(
                        size: 15,
                        value: 1,
                        groupValue: 1,
                        // radioColor: ,
                        radioColor: ColorConstant.primaryColor,
                        activeBgColor: ColorConstant.primaryColor,
                        activeBorderColor: const Color.fromRGBO(0, 0, 0, 0.15),
                        onChanged: (value) => {print(value)},
                      ),
                    ),
                    Padding(
                      padding: const EdgeInsets.only(left: EdgeConstant.edge10),
                      child: Text(
                        S.of(context).all,
                        // S.of(context).all,
                        style: const TextStyle(
                            color: Colors.black, fontSize: FontConstant.f13),
                      ),
                    )
                  ],
                ),
                Expanded(
                    child: Padding(
                  padding: const EdgeInsets.only(left: EdgeConstant.edge5),
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.end,
                    crossAxisAlignment: CrossAxisAlignment.center,
                    children: [
                      Text(
                        S.of(context).subtotal,
                        style: const TextStyle(
                          color: ColorConstant.grey888,
                          fontSize: FontConstant.f12,
                        ),
                      ),
                      Container(
                        padding: const EdgeInsets.symmetric(
                            horizontal: EdgeConstant.edge5),
                        constraints: const BoxConstraints(maxWidth: 100),
                        child: const Flexible(
                          child: AutoSizeText(
                            '1',
                            maxLines: 2,
                            softWrap: true,
                            minFontSize: FontConstant.f12,
                            overflow: TextOverflow.ellipsis,
                            textAlign: TextAlign.right,
                            style: TextStyle(
                                color: ColorConstant.primaryColor,
                                fontSize: FontConstant.f18,
                                fontWeight: FontWeight.w600),
                          ),
                        ),
                      ),
                      GFButton(
                        onPressed: () {},
                        text: S.of(context).checkOut,
                        shape: GFButtonShape.pills,
                        color: ColorConstant.primaryColor,
                        padding: const EdgeInsets.symmetric(
                            horizontal: EdgeConstant.edge20,
                            vertical: EdgeConstant.edge5),
                      )
                    ],
                  ),
                ))
              ],
            )));
  }
}
